<!DOCTYPE html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>题库</title>
</head>
<script>
    $(function () {
        //加载该页面前，先判断该模块的权限
        //获取当前登录的用户的权限
        var permission = document.cookie.split(";")[1].split("=")[1];
        var b = String(permission).split('');
        for (var i = 0; i < b.length; i++) {
            console.log(b[i]);
        }
        var moudle11 = b[1];
        //如果模块权限为1，即只能查询此模块下的数据，不能进行修改（禁用和重置密码不能使用）
        //系统管理
        if (moudle11 == 1) {
            $(".input-update").attr("disabled","disabled");
            $(".input-del").attr("disabled","disabled");
        }
    })
</script>
<style type="text/css">
    table {
        width: 100%;
    }

    .selected {
        color: white;
        height: 25px;
        width: 100px;
        margin-top: 10px;
        margin-bottom: 20px;
        margin-left: 50px;
        border-color: #1ab7ea;
        appearance: none;
        -moz-appearance: none;
        -webkit-appearance: none;
        background: url("http://ourjs.github.io/static/2015/arrow.png") no-repeat scroll right center transparent;
    }

    #input-seach {
        position: absolute;
        margin-left: 550px;
        margin-top: 6px;
        height: 30px;
        width: 300px;
        border: violet 2px solid;
    }

    #a-add {
        position: absolute;
        font-size: 80px;
        color: aquamarine;
        margin-left: 890px;
        margin-top: -35px;
        text-decoration: none;
    }

    .input-del, .input-update {
        height: 30px;
        width: 60px;
        border: none;
        background-color: orange;
        font-size: medium;
        margin-left: 20px;
    }

    td {
        text-align: center;
    }

    #buttons-seach {
        position: absolute;
        margin-left: 860px;
        margin-top: 10px;
        border: none;
        background-color: black;
        font-size: large;
    }

    #div-cutpage {

        position: absolute;
        margin-top: -20px;
        margin-left: 800px;
    }

</style>
<script type="text/javascript" src="../../js/jquery-2.2.3.min.js"></script>
<script type="text/javascript" src="saveMoudle/Ajax/getQuestionsAjax.js"></script>
<script type="text/javascript" src="saveMoudle/Ajax/addQuestionsAjax.js"></script>
<script type="text/javascript" src="saveMoudle/Ajax/deleteQuestionsAjax.js"></script>
<body>

<div style="height: 60px;width: 100%;background-color: black">
    <input type="text" placeholder="搜索..." id="input-seach">
    <input type="button" value="🔍" id="buttons-seach" onclick="getQuestionsInfo()">
    <select name="" id="choose-scope" class="selected" onchange="getQuestionsInfo()">
        <option value="0">全部</option>
        <option value="1">消费性</option>
        <option value="2">经营性</option>
        <option value="3">按揭性</option>
    </select>
    <select name="" id="choose-type" class="selected" onchange="getQuestionsInfo()">
        <option value="0">全部</option>
        <option value="1">选择题</option>
        <option value="2">是非题</option>
    </select>

    <a href="#" id="a-add" data-toggle="modal" data-target="#addQuestions" onclick="allrate()">+</a>
</div>

<div class="grid-table" style="height: 615px;width: 100%;">


    <table class="">
        <thead style="background-color:skyblue">
        <tr>
            <td>问题ID</td>
            <td>问题名称</td>
            <td>问题种类</td>
            <td>适用范围</td>
            <td>选项</td>
            <td>操作</td>
        </tr>
        </thead>
        <tbody>
        <tr class="tbody-tr" style="display: none">
            <td class="td-id">11</td>
            <td class="td-content">11</td>
            <td class="td-type">22</td>
            <td class="td-scope">11</td>
            <td><select class="select-answer" style="width: 200px; ">
                <option value="0" selected="selected">点击查看</option>
            </select></td>
            <td>
                <input type="button" class="input-update" data-toggle="modal" data-target="#addQuestions" value="修改"
                       onclick="updatequestions(this)">
                <input type="button" class="input-del" value="删除" onclick="deleteQuestions(this)">
            </td>
        </tr>

        <tr class="tbody-tr" style="display: none">
            <td class="td-id">11</td>
            <td class="td-content">11</td>
            <td class="td-type">22</td>
            <td class="td-scope">11</td>
            <td><select class="select-answer" style="width: 200px; ">
                <option value="0" selected="selected">点击查看</option>
            </select></td>
            <td>
                <input type="button" class="input-update" data-toggle="modal" data-target="#addQuestions" value="修改"
                       onclick="updatequestions(this)">
                <input type="button" class="input-del" value="删除" onclick="deleteQuestions(this)">
            </td>
        </tr>

        <tr class="tbody-tr" style="display: none">
            <td class="td-id">11</td>
            <td class="td-content">11</td>
            <td class="td-type">22</td>
            <td class="td-scope">11</td>
            <td><select class="select-answer" style="width: 200px; ">
                <option value="0" selected="selected">点击查看</option>
            </select></td>
            <td>
                <input type="button" class="input-update" data-toggle="modal" data-target="#addQuestions" value="修改"
                       onclick="updatequestions(this)">
                <input type="button" class="input-del" value="删除" onclick="deleteQuestions(this)">
            </td>
        </tr>

        <tr class="tbody-tr" style="display: none">
            <td class="td-id">11</td>
            <td class="td-content">11</td>
            <td class="td-type">22</td>
            <td class="td-scope">11</td>
            <td><select class="select-answer" style="width: 200px; ">
                <option value="0" selected="selected">点击查看</option>
            </select></td>
            <td>
                <input type="button" class="input-update" data-toggle="modal" data-target="#addQuestions" value="修改"
                       onclick="updatequestions(this)">
                <input type="button" class="input-del" value="删除" onclick="deleteQuestions(this)">
            </td>
        </tr>
        <tr class="tbody-tr" style="display: none">
            <td class="td-id">11</td>
            <td class="td-content">11</td>
            <td class="td-type">22</td>
            <td class="td-scope">11</td>
            <td><select class="select-answer" style="width: 200px; ">
                <option value="0" selected="selected">点击查看</option>
            </select></td>
            <td>
                <input type="button" class="input-update" data-toggle="modal" data-target="#addQuestions" value="修改"
                       onclick="updatequestions(this)">
                <input type="button" class="input-del" value="删除" onclick="deleteQuestions(this)">
            </td>
        </tr>
        <tr class="tbody-tr" style="display: none">
            <td class="td-id">11</td>
            <td class="td-content">11</td>
            <td class="td-type">22</td>
            <td class="td-scope">11</td>
            <td><select class="select-answer" style="width: 200px; ">
                <option value="0" selected="selected">点击查看</option>
            </select></td>
            <td>
                <input type="button" class="input-update" data-toggle="modal" data-target="#addQuestions" value="修改"
                       onclick="updatequestions(this)">
                <input type="button" class="input-del" value="删除" onclick="deleteQuestions(this)">
            </td>
        </tr>

        <tr class="tbody-tr" style="display: none">
            <td class="td-id">11</td>
            <td class="td-content">11</td>
            <td class="td-type">22</td>
            <td class="td-scope">11</td>
            <td><select class="select-answer" style="width: 200px; ">
                <option value="0" selected="selected">点击查看</option>
            </select></td>
            <td>
                <input type="button" class="input-update" data-toggle="modal" data-target="#addQuestions" value="修改"
                       onclick="updatequestions(this)">
                <input type="button" class="input-del" value="删除" onclick="deleteQuestions(this)">
            </td>
        </tr>

        <tr class="tbody-tr" style="display: none">
            <td class="td-id">11</td>
            <td class="td-content">11</td>
            <td class="td-type">22</td>
            <td class="td-scope">11</td>
            <td><select class="select-answer" style="width: 200px; ">
                <option value="0" selected="selected">点击查看</option>
            </select></td>
            <td>
                <input type="button" class="input-update" data-toggle="modal" data-target="#addQuestions" value="修改"
                       onclick="updatequestions(this)">
                <input type="button" class="input-del" value="删除" onclick="deleteQuestions(this)">
            </td>
        </tr>
        <tr class="tbody-tr" style="display: none">
            <td class="td-id">11</td>
            <td class="td-content">11</td>
            <td class="td-type">22</td>
            <td class="td-scope">11</td>
            <td><select class="select-answer" style="width: 200px; ">
                <option value="0" selected="selected">点击查看</option>
            </select></td>
            <td>
                <input type="button" class="input-update" data-toggle="modal" data-target="#addQuestions" value="修改"
                       onclick="updatequestions(this)">
                <input type="button" class="input-del" value="删除" onclick="deleteQuestions(this)">
            </td>
        </tr>

        <tr class="tbody-tr" style="display: none">
            <td class="td-id">11</td>
            <td class="td-content">11</td>
            <td class="td-type">22</td>
            <td class="td-scope">11</td>
            <td><select class="select-answer" style="width: 200px; ">
                <option value="0" selected="selected">点击查看</option>
            </select></td>
            <td>
                <input type="button" class="input-update" data-toggle="modal" data-target="#addQuestions" value="修改"
                       onclick="updatequestions(this)">
                <input type="button" class="input-del" value="删除" onclick="deleteQuestions(this)">
            </td>
        </tr>
        <tr class="tbody-tr" style="display: none">
            <td class="td-id">11</td>
            <td class="td-content">11</td>
            <td class="td-type">22</td>
            <td class="td-scope">11</td>
            <td><select class="select-answer" style="width: 200px; ">
                <option value="0" selected="selected">点击查看</option>
            </select></td>
            <td>
                <input type="button" class="input-update" data-toggle="modal" data-target="#addQuestions" value="修改"
                       onclick="updatequestions(this)">
                <input type="button" class="input-del" value="删除" onclick="deleteQuestions(this)">
            </td>
        </tr>
        </tbody>
    </table>

</div>
<div id="grid-pager" class="box-footer" style="background-color:#ecf0f5">
    <div id="div-cutpage">
        <a href="#" onclick="gohead()">首页</a>
        <a href="#" onclick="devPage()">上一页</a>
        <a href="#" onclick="addPage()">下一页</a>
        <select id="a-jump" onchange="jumpPage()">

        </select>
        当前第<a id="a-index"></a>页,
        共<a id="a-sum"></a>页
    </div>

</div>
<div class="modal fade bs-example-modal-lg" id="addQuestions" tabindex="-1" role="dialog">
    <div class="modal-dialog modal-lg" role="document">
        <form id="editPasswordForm" role="form" class="form-horizontal">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                            aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="indexModeltitle">添加问题</h4>
                </div>

                <div class="modal-body">
                    <div class="col-xs-8 col-xs-offset-2">
                        <input type="hidden" id="indexId" name="indexId" value="0"/>

                        <div class="form-group" id="div-id">
                            <label for="input-id" class="col-sm-2 control-label">ID：</label>
                            <div class="col-sm-6">
                                <input type="text" class="form-control" id="input-id" name="indexMechanismCode"
                                       disabled="true" value="">
                            </div>
                        </div>

                        <div class="form-group">
                            <label for="content" class="col-sm-2 control-label">问题：</label>
                            <div class="col-sm-6">
                                <input type="text" class="form-control" id="content" name="indexMechanismCode"
                                       onchange="checknotnull()" placeholder="问题" value="">
                            </div>
                        </div>

                        <div class="form-group">
                            <label for="all-rate" class="col-sm-2 control-label">总分数：</label>
                            <div class="col-sm-6">
                                <select class="form-control" id="all-rate" onchange="arate()">

                                </select>
                            </div>
                        </div>

                        <div class="form-group">
                            <label for="selected" class="col-sm-2 control-label" onclick="" id="select-type">类型：</label>
                            <div class="col-sm-6">
                                <select class="form-control" id="selected" onchange="choosetype()">
                                    <option value="1">选择题</option>
                                    <option value="2">是非题</option>
                                </select>
                            </div>
                        </div>

                        <div class="form-group">
                            <label for="scope" class="col-sm-2 control-label" onclick="" id="select-scope">范围：</label>
                            <div class="col-sm-6">
                                <select class="form-control" id="scope" onchange="checknotnull()">
                                    <option value="1">消费性</option>
                                    <option value="2">经营性</option>
                                    <option value="3">按揭性</option>
                                </select>
                            </div>
                        </div>

                        <div class="form-group">
                            <label for="text-a" class="col-sm-2 control-label ">选项A：</label>
                            <div class="col-sm-6">
                                <input type="text" class="form-control " id="text-a" onchange="checknotnull()"
                                       name="indexPass" placeholder="请输入选项A的内容">
                            </div>
                            <label for="a-rate" class="col-sm-2 control-label" id="select-rate1">分数：</label>
                            <div class="col-sm-6" style="position: absolute;margin-left: 500px;">
                                <select class="form-control" id="a-rate" style="width: 100px;" onchange="brate()">
                                </select>
                            </div>
                        </div>

                        <div class="form-group">
                            <label for="text-b" class="col-sm-2 control-label ">选项B：</label>
                            <div class="col-sm-6">
                                <input type="text" class="form-control " id="text-b" onchange="checknotnull()"
                                       name="indexPass" placeholder="请输入选项B的内容">
                            </div>
                            <label for="b-rate" class="col-sm-2 control-label" id="select-rate4">分数：</label>
                            <div class="col-sm-6" style="position: absolute;margin-left: 500px;">
                                <select class="form-control" id="b-rate" style="width: 100px;" onchange="crate()">
                                </select>
                                <p id="rate-test1"></p>
                            </div>
                        </div>
                        <div class="form-group" id="div-c">
                            <label for="text-c" class="col-sm-2 control-label ">选项C：</label>
                            <div class="col-sm-6">
                                <input type="text" class="form-control " id="text-c" onchange="checknotnull()"
                                       name="indexPass" placeholder="请输入选项C的内容">
                            </div>
                            <label for="c-rate" class="col-sm-2 control-label" id="select-rate2">分数：</label>
                            <div class="col-sm-6" style="position: absolute;margin-left: 500px;">
                                <select class="form-control" id="c-rate" style="width: 100px;" onchange="drate()">
                                </select>
                            </div>
                        </div>
                        <div class="form-group" id="div-d">
                            <label for="text-d" class="col-sm-2 control-label ">选项D：</label>
                            <div class="col-sm-6">
                                <input type="text" class="form-control " id="text-d" onchange="checknotnull()"
                                       name="indexPass" placeholder="请输入选项D的内容">
                            </div>
                            <label for="d-rate" class="col-sm-2 control-label" id="select-rate3">分数：</label>
                            <div class="col-sm-6" style="position: absolute;margin-left: 500px;">
                                <select class="form-control" id="d-rate" onchange="checknotnull()"
                                        style="width: 100px;">
                                </select>
                                <p id="rate-test2"></p>
                            </div>
                        </div>
                    </div>
                    <div class="clearfix"></div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal"><i
                            class="fa fa-close button-in-i"></i>取消
                    </button>
                    <button type="button" class="btn btn-primary" data-dismiss="modal" id="indexUpdateBtn"
                            onclick="addQuestions()"><i class="fa fa-check button-in-i"></i>保存
                    </button>
                    <span></span>
                </div>
            </div>
        </form>
    </div>
</div>
</body>
</html>